import { privateRequest } from '@/utils/request';
import type { IUserParams, IUserInfo, ISetUserParams, IDelParams } from './type';

enum API {
	// 用户
	User = '/system/user',
	// 角色
	Role = '/system/user/role',
	// 新增用户
	SetUser = '/system/setuser',
	// 删除用户
	DelUser = '/system/user/deluser',
}

export const useUser = (data: IUserParams) => privateRequest.post<IUserInfo>(API.User, data);
export const useRole = () => privateRequest.get<string[]>(API.Role);
export const useSetUser = (data: ISetUserParams) => privateRequest.post<string>(API.SetUser, data);
export const useDelUser = (params: IDelParams) => privateRequest.delete<string>(API.DelUser, params);
